home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1960 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: sdd.hp.com!inn
  2. From: Jeff Grimmett <jgrimm@sdd.hp.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: More linked list nonsense
  5. Date: 25 Jan 1996 16:12:02 GMT
  6. Organization: Hewlett-Packard Company
  7. Message-ID: <4e8a4i$rht@news.sdd.hp.com>
  8. References: <4e5nih$iib@news.sdd.hp.com> <4e5rp4$tub@rs18.hrz.th-darmstadt.de>
  9. NNTP-Posting-Host: hpsdv330.sdd.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  14.  
  15. kraemer@clri6a.gsi.de (Michael Kraemer) wrote:
  16.  
  17. >> It just occurred to me last night, as I pored over steaming code, that 
  18. >> the function Remove() (used to remove nodes from linked lists) might 
  19. >> POSSIBLY not be freeing the memory allocated to the node it is removing. 
  20. >> Does anyone have some insight on this?  It's difficult to deallocate a 
  21. >> node once it's not part of the list, but it's pretty STUPID to free it 
  22. >> BEFORE. :-)
  23.  
  24. >   struct Node *pln;
  25. >
  26. >   Remove(pln);         /* remove it from the list */
  27. >   free(pln);           /* remove it from memory */
  28.  
  29. DOH!  Connection made... it just occurs to me that the node still exists, 
  30. just isn't part of the list anymore...
  31.  
  32. (sigh.  I have to quite coding at midnight)
  33.  
  34.